<template>
<div>
  <h1>{{msg}}</h1>
  <h2>女儿的名字：{{name}}</h2>
  <h2>女儿的年龄：{{MyAge}}</h2>
  <button @click="addAge">点我给女儿的年龄+1</button>
</div>
</template>

<script>
    export default {
        name: "MyDaughter",
        data(){
          return{
            msg:"欢迎你的到来~",
            MyAge:this.age
          }
        },
        props:{
          name:{
            type:String,
            required:true,
          },
          age:{
            type:Number,
            default:10
          }
        },
      methods:{
        addAge(){
          this.MyAge++;
        }
      }
    }
</script>

